#ifndef __OLED_H__
#define __OLED_H__

#include "esp_check.h"

#define OLED_I2C_SDA_IO 19          //I2C SDA GPIO Number   
#define OLED_I2C_SCL_IO 18          //I2C SCL GPIO Number    
#define OLED_I2C_POER_NUM 1         //OLED 使用的 I2C 驱动号
#define OLED_I2C_FREQ 400000        //OLED 对应 I2C 时钟  
#define OLED_ADDR 0x3c              //OLED I2C 器件地址    

#define WRITE_BIT I2C_MASTER_WRITE  //I2C master write 
#define READ_BIT I2C_MASTER_READ    //I2C master read 
#define ACK_CHECK_EN 0x1            //I2C master will check ack from slave
#define ACK_CHECK_DIS 0x0           //I2C master will not check ack from slave 
#define ACK_VAL 0x0                 //I2C ack value 
#define NACK_VAL 0x1                //I2C nack value

void oled_clear(void);
void oled_clear_page(int page);
esp_err_t oled_write(const uint8_t *data_wr, size_t size);
esp_err_t oled_set_start_address(uint8_t page_addr, uint16_t ram_addr);

esp_err_t oled_init();

#endif
